<!DOCTYPE html>
<html lang="zh-CN">
<head>
  <meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=2">
<meta name="theme-color" content="#222">
<meta name="generator" content="Hexo 4.2.1">
  <link rel="apple-touch-icon" sizes="180x180" href="/images/apple-touch-icon-next.png">
  <link rel="icon" type="image/png" sizes="32x32" href="/images/dute_favicon_32x32.png">
  <link rel="icon" type="image/png" sizes="16x16" href="/images/dute_favicon_16x16.png">
  <link rel="mask-icon" href="/images/logo.svg" color="#222">
  <link rel="manifest" href="/images/manifest.json">
  <meta name="msapplication-config" content="/images/browserconfig.xml">
  <meta http-equiv="Cache-Control" content="no-transform">
  <meta http-equiv="Cache-Control" content="no-siteapp">
  <meta name="google-site-verification" content="mpI5dkydstZXl6UcDCppqktXK0bbvqdZ6LkZ3KNk4Iw">
  <meta name="baidu-site-verification" content="code-a1LksZX2Ds">

<link rel="stylesheet" href="/css/main.css">


<link rel="stylesheet" href="/lib/font-awesome/css/font-awesome.min.css">
  <link rel="stylesheet" href="//cdn.jsdelivr.net/gh/fancyapps/fancybox@3/dist/jquery.fancybox.min.css">

<script id="hexo-configurations">
    var NexT = window.NexT || {};
    var CONFIG = {"hostname":"whitestore.top","root":"/","scheme":"Gemini","version":"7.8.0","exturl":true,"sidebar":{"position":"left","display":"post","padding":18,"offset":12,"onmobile":false},"copycode":{"enable":true,"show_result":false,"style":null},"back2top":{"enable":true,"sidebar":true,"scrollpercent":true},"bookmark":{"enable":false,"color":"#222","save":"auto"},"fancybox":true,"mediumzoom":false,"lazyload":false,"pangu":false,"comments":{"style":"tabs","active":null,"storage":true,"lazyload":false,"nav":null},"algolia":{"hits":{"per_page":10},"labels":{"input_placeholder":"Search for Posts","hits_empty":"We didn't find any results for the search: ${query}","hits_stats":"${hits} results found in ${time} ms"}},"localsearch":{"enable":true,"trigger":"auto","top_n_per_article":1,"unescape":false,"preload":false},"motion":{"enable":true,"async":false,"transition":{"post_block":"fadeIn","post_header":"slideDownIn","post_body":"slideDownIn","coll_header":"slideLeftIn","sidebar":"slideUpIn"}},"path":"search.xml"};
  </script>

  <meta name="description" content="jvm阶段总结和处理">
<meta property="og:type" content="article">
<meta property="og:title" content="深入理解JVM - 阶段总结与回顾（一）">
<meta property="og:url" content="https://whitestore.top/2022/01/28/huigu1/index.html">
<meta property="og:site_name" content="爱看书的阿东">
<meta property="og:description" content="jvm阶段总结和处理">
<meta property="og:locale" content="zh_CN">
<meta property="article:published_time" content="2022-01-28T15:29:51.000Z">
<meta property="article:modified_time" content="2023-07-16T06:28:09.272Z">
<meta property="article:author" content="阿东">
<meta property="article:tag" content="关于jvm的阶段总结处理">
<meta name="twitter:card" content="summary">

<link rel="canonical" href="https://whitestore.top/2022/01/28/huigu1/">


<script id="page-configurations">
  // https://hexo.io/docs/variables.html
  CONFIG.page = {
    sidebar: "",
    isHome : false,
    isPost : true,
    lang   : 'zh-CN'
  };
</script>

  <title>深入理解JVM - 阶段总结与回顾（一） | 爱看书的阿东</title>
  






  <noscript>
  <style>
  .use-motion .brand,
  .use-motion .menu-item,
  .sidebar-inner,
  .use-motion .post-block,
  .use-motion .pagination,
  .use-motion .comments,
  .use-motion .post-header,
  .use-motion .post-body,
  .use-motion .collection-header { opacity: initial; }

  .use-motion .site-title,
  .use-motion .site-subtitle {
    opacity: initial;
    top: initial;
  }

  .use-motion .logo-line-before i { left: initial; }
  .use-motion .logo-line-after i { right: initial; }
  </style>
</noscript>

<link rel="alternate" href="/atom.xml" title="爱看书的阿东" type="application/atom+xml">
</head>

<body itemscope itemtype="http://schema.org/WebPage">
  <div class="container use-motion">
    <div class="headband"></div>

    <header class="header" itemscope itemtype="http://schema.org/WPHeader">
      <div class="header-inner"><div class="site-brand-container">
  <div class="site-nav-toggle">
    <div class="toggle" aria-label="切换导航栏">
      <span class="toggle-line toggle-line-first"></span>
      <span class="toggle-line toggle-line-middle"></span>
      <span class="toggle-line toggle-line-last"></span>
    </div>
  </div>

  <div class="site-meta">

    <a href="/" class="brand" rel="start">
      <span class="logo-line-before"><i></i></span>
      <h1 class="site-title">爱看书的阿东</h1>
      <span class="logo-line-after"><i></i></span>
    </a>
      <p class="site-subtitle" itemprop="description">赐他一块白色石头，石头上写着新名</p>
  </div>

  <div class="site-nav-right">
    <div class="toggle popup-trigger">
        <i class="fa fa-search fa-fw fa-lg"></i>
    </div>
  </div>
</div>




<nav class="site-nav">
  <ul id="menu" class="menu">
        <li class="menu-item menu-item-home">

    <a href="/" rel="section"><i class="fa fa-fw fa-home"></i>首页</a>

  </li>
        <li class="menu-item menu-item-tags">

    <a href="/tags/" rel="section"><i class="fa fa-fw fa-tags"></i>标签</a>

  </li>
        <li class="menu-item menu-item-categories">

    <a href="/categories/" rel="section"><i class="fa fa-fw fa-th"></i>分类</a>

  </li>
        <li class="menu-item menu-item-archives">

    <a href="/archives/" rel="section"><i class="fa fa-fw fa-archive"></i>归档</a>

  </li>
        <li class="menu-item menu-item-sitemap">

    <a href="/sitemap.xml" rel="section"><i class="fa fa-fw fa-sitemap"></i>站点地图</a>

  </li>
      <li class="menu-item menu-item-search">
        <a role="button" class="popup-trigger"><i class="fa fa-search fa-fw"></i>搜索
        </a>
      </li>
  </ul>
</nav>



  <div class="search-pop-overlay">
    <div class="popup search-popup">
        <div class="search-header">
  <span class="search-icon">
    <i class="fa fa-search"></i>
  </span>
  <div class="search-input-container">
    <input autocomplete="off" autocapitalize="off"
           placeholder="搜索..." spellcheck="false"
           type="search" class="search-input">
  </div>
  <span class="popup-btn-close">
    <i class="fa fa-times-circle"></i>
  </span>
</div>
<div id="search-result">
  <div id="no-result">
    <i class="fa fa-spinner fa-pulse fa-5x fa-fw"></i>
  </div>
</div>

    </div>
  </div>

</div>
    </header>

    

  <span class="exturl github-corner" data-url="aHR0cHM6Ly9naXRodWIuY29tL2xhenlUaW1lcw==" title="Follow me on GitHub" aria-label="Follow me on GitHub"><svg width="80" height="80" viewBox="0 0 250 250" aria-hidden="true"><path d="M0,0 L115,115 L130,115 L142,142 L250,250 L250,0 Z"></path><path d="M128.3,109.0 C113.8,99.7 119.0,89.6 119.0,89.6 C122.0,82.7 120.5,78.6 120.5,78.6 C119.2,72.0 123.4,76.3 123.4,76.3 C127.3,80.9 125.5,87.3 125.5,87.3 C122.9,97.6 130.6,101.9 134.4,103.2" fill="currentColor" style="transform-origin: 130px 106px;" class="octo-arm"></path><path d="M115.0,115.0 C114.9,115.1 118.7,116.5 119.8,115.4 L133.7,101.6 C136.9,99.2 139.9,98.4 142.2,98.6 C133.8,88.0 127.5,74.4 143.8,58.0 C148.5,53.4 154.0,51.2 159.7,51.0 C160.3,49.4 163.2,43.6 171.4,40.1 C171.4,40.1 176.1,42.5 178.8,56.2 C183.1,58.6 187.2,61.8 190.9,65.4 C194.5,69.0 197.7,73.2 200.1,77.6 C213.8,80.2 216.3,84.9 216.3,84.9 C212.7,93.1 206.9,96.0 205.4,96.6 C205.1,102.4 203.0,107.8 198.3,112.5 C181.9,128.9 168.3,122.5 157.7,114.1 C157.9,116.9 156.7,120.9 152.7,124.9 L141.0,136.5 C139.8,137.7 141.6,141.9 141.8,141.8 Z" fill="currentColor" class="octo-body"></path></svg></span>


    <main class="main">
      <div class="main-inner">
        <div class="content-wrap">
          

          <div class="content post posts-expand">
            

    
  
  
  <article itemscope itemtype="http://schema.org/Article" class="post-block" lang="zh-CN">
    <link itemprop="mainEntityOfPage" href="https://whitestore.top/2022/01/28/huigu1/">

    <span hidden itemprop="author" itemscope itemtype="http://schema.org/Person">
      <meta itemprop="image" content="/images/avatar.gif">
      <meta itemprop="name" content="阿东">
      <meta itemprop="description" content="随遇而安">
    </span>

    <span hidden itemprop="publisher" itemscope itemtype="http://schema.org/Organization">
      <meta itemprop="name" content="爱看书的阿东">
    </span>
      <header class="post-header">
        <h1 class="post-title" itemprop="name headline">
          深入理解JVM - 阶段总结与回顾（一）
        </h1>

        <div class="post-meta">
            <span class="post-meta-item">
              <span class="post-meta-item-icon">
                <i class="fa fa-calendar-o"></i>
              </span>
              <span class="post-meta-item-text">发表于</span>

              <time title="创建时间：2022-01-28 23:29:51" itemprop="dateCreated datePublished" datetime="2022-01-28T23:29:51+08:00">2022-01-28</time>
            </span>
              <span class="post-meta-item">
                <span class="post-meta-item-icon">
                  <i class="fa fa-calendar-check-o"></i>
                </span>
                <span class="post-meta-item-text">更新于</span>
                <time title="修改时间：2023-07-16 14:28:09" itemprop="dateModified" datetime="2023-07-16T14:28:09+08:00">2023-07-16</time>
              </span>
            <span class="post-meta-item">
              <span class="post-meta-item-icon">
                <i class="fa fa-folder-o"></i>
              </span>
              <span class="post-meta-item-text">分类于</span>
                <span itemprop="about" itemscope itemtype="http://schema.org/Thing">
                  <a href="/categories/JVM/" itemprop="url" rel="index"><span itemprop="name">JVM</span></a>
                </span>
            </span>

          
            <span class="post-meta-item" title="阅读次数" id="busuanzi_container_page_pv" style="display: none;">
              <span class="post-meta-item-icon">
                <i class="fa fa-eye"></i>
              </span>
              <span class="post-meta-item-text">阅读次数：</span>
              <span id="busuanzi_value_page_pv"></span>
            </span>
  
  <span class="post-meta-item">
    
      <span class="post-meta-item-icon">
        <i class="fa fa-comment-o"></i>
      </span>
      <span class="post-meta-item-text">Valine：</span>
    
    <a title="valine" href="/2022/01/28/huigu1/#valine-comments" itemprop="discussionUrl">
      <span class="post-comments-count valine-comment-count" data-xid="/2022/01/28/huigu1/" itemprop="commentCount"></span>
    </a>
  </span>
  
  <br>
            <span class="post-meta-item" title="本文字数">
              <span class="post-meta-item-icon">
                <i class="fa fa-file-word-o"></i>
              </span>
                <span class="post-meta-item-text">本文字数：</span>
              <span>2.9k</span>
            </span>
            <span class="post-meta-item" title="阅读时长">
              <span class="post-meta-item-icon">
                <i class="fa fa-clock-o"></i>
              </span>
                <span class="post-meta-item-text">阅读时长 &asymp;</span>
              <span>3 分钟</span>
            </span>
            <div class="post-description">jvm阶段总结和处理</div>

        </div>
      </header>

    
    
    
    <div class="post-body" itemprop="articleBody">

      
        <h1 id="深入理解JVM-阶段总结与回顾（一）"><a href="#深入理解JVM-阶段总结与回顾（一）" class="headerlink" title="深入理解JVM - 阶段总结与回顾（一）"></a>深入理解JVM - 阶段总结与回顾（一）</h1><h1 id="前言"><a href="#前言" class="headerlink" title="前言"></a>前言</h1><p>​    这篇文章不写新内容，而是回顾之前的文章内容。</p>
<h1 id="为什么开设专栏"><a href="#为什么开设专栏" class="headerlink" title="为什么开设专栏"></a>为什么开设专栏</h1><p>​    开设这个专栏的目的毫无疑问是给个人的成长做一个记录和归档，因为这段时间下来发现学东西一定要系统并且有目的循序渐进的学才有更快的成长，JVM的内容和细节是学不完的，所以要清楚学这个东西的作用是什么很关键，个人学这个东西无非就是为了面试以及了解底层原理，同时本着书到用时方恨少的原则编写专栏。</p>
<h1 id="系列文章阶段总结："><a href="#系列文章阶段总结：" class="headerlink" title="系列文章阶段总结："></a>系列文章阶段总结：</h1><p>​    专栏地址：<span class="exturl" data-url="aHR0cHM6Ly9qdWVqaW4uY24vY29sdW1uLzY5Nzk1MzA1NzAzNTUzNDMzNjg=" title="https://juejin.cn/column/6979530570355343368">深入理解JVM虚拟机<i class="fa fa-external-link"></i></span></p>
<p>​    第一篇：<a href="juejin.cn/post/6979529931952750623">深入理解JVM虚拟机 - JVM的初步了解</a></p>
<p>​    系列的开篇，在第一篇专栏我们需要了解JVM到底是个什么东西，他对于JAVA开发者而言的重要意义，同时我们编写的代码是如何通过JVM运行并且实现我们想要的效果的，重点在于JAVA加载到JVM的工作流程。</p>
<p>​    这里也讲述了JVM的双亲委派模型和Tomcat的双亲委派模型是如何打破他的，类加载器也是JVM的一个核心内容。</p>
<p>​    第二篇：<span class="exturl" data-url="aHR0cHM6Ly9qdWVqaW4uY24vcG9zdC82OTcxMDc3NTk2NjI0NzE1ODEz" title="https://juejin.cn/post/6971077596624715813">深入理解JVM虚拟机 - 虚拟机的发展历史<i class="fa fa-external-link"></i></span></p>
<p>​    基本就是《深入理解JVM虚拟机》的笔记了，当然很多博客也介绍了。</p>
<p>​    第三篇：<span class="exturl" data-url="aHR0cHM6Ly9qdWVqaW4uY24vcG9zdC82OTgzMDYyOTk2NjI0ODY3MzM2" title="https://juejin.cn/post/6983062996624867336">深入理解JVM - 分代的基本概念<i class="fa fa-external-link"></i></span></p>
<p>​    讲述了JVM的传统分代模型的特点，以及新生代和老年代的划分，重点是新生代如何进入老年代，需要的条件以及相关的参数设置也是面试高频点。最后介绍了JVM的调优参数。</p>
<p>​    第四篇：<a href="juejin.cn/post/6970557978831388709">深入理解JVM虚拟机 - jvm的对象分配策略</a></p>
<p>​    这篇文章个人认为值得关注的点是实际的JVM测试结果和书里面不一样！同时可以发现新版本当中的Parnew会在连续分配大对象的时候让对象直接进入老年代，真的很奇怪！还是建议学这些东西一定自己尝试，花点时间换来的收益是你意向不到的！</p>
<p>​    第五篇：<a href="juejin.cn/post/6984356543470764068">深入理解JVM - 垃圾回收算法</a></p>
<p>​    和标题一样，介绍JVM的垃圾回收算法以及新生代老年代是如何运用算法进行回收的，需要注意的是这些垃圾算法没有好坏之分，一切看实际垃圾收集器开发者的设计理念。比如CMS还是典型的标记-清除，但是到了G1就是标记整理了。</p>
<p>​    第六篇：<a href="juejin.cn/post/6985036085390737415">深入理解JVM - CMS收集器</a></p>
<p>​    讲述CMS收集器的手机细节，以及CMS的好搭档ParNew的一些处理细节，CMS+ParNew相信还是多数公司的首选垃圾收集器。毕竟不是谁都有那么庞大的用户量或者大项目这种。</p>
<p>​    第七篇：<span class="exturl" data-url="aHR0cHM6Ly9qdWVqaW4uY24vcG9zdC82OTg1MTc0NjM5Mjk1MDcwMjIy" title="https://juejin.cn/post/6985174639295070222">深入理解JVM - 实战老年代优化<i class="fa fa-external-link"></i></span></p>
<p>​    无需多介绍，内容和标题类似。</p>
<p>​    第八篇：<span class="exturl" data-url="aHR0cHM6Ly9qdWVqaW4uY24vcG9zdC82OTg3MjI0Nzc5ODI0NTYyMjA2" title="https://juejin.cn/post/6987224779824562206">深入理解JVM - G1收集器<i class="fa fa-external-link"></i></span></p>
<p>​    功能和使用看似都十分简单，然而内含的原理十分复杂，主要也是讲解G1收集器的一些功能和细节点。</p>
<p>​    同时是否需要研究原理这就看个人需求了，当然多懂点总是好事。</p>
<p>​    第九篇：<span class="exturl" data-url="aHR0cHM6Ly9qdWVqaW4uY24vcG9zdC82OTg3OTYxNDA1OTQ1MTUxNTAy" title="https://juejin.cn/post/6987961405945151502">深入理解JVM - G1调优简述<i class="fa fa-external-link"></i></span></p>
<p>​    感觉完全是水了一篇，可以不看，因为个人目前没遇到需要用上G1去调优的场景（=-=）</p>
<a id="more"></a>

<h1 id="相关讨论"><a href="#相关讨论" class="headerlink" title="相关讨论"></a>相关讨论</h1><h2 id="回收的说法我混淆了？"><a href="#回收的说法我混淆了？" class="headerlink" title="回收的说法我混淆了？"></a>回收的说法我混淆了？</h2><p>​    <strong>Minor gc</strong>： 中文翻译是次要GC，次要这两个字很容易混淆，但是多数情况是<strong>新生代回收</strong></p>
<p>​    <strong>Young gc</strong>：新生代回收</p>
<p>​    <strong>Full gc</strong>：多数人会认为是老年代回收，然而实际上和这个单词的含义不同，所以full GC应该类似于<strong>全堆回收</strong></p>
<p>​    <strong>Old gc</strong>：毫无疑问就是老年代回收</p>
<p>​    <strong>Major gc</strong>： 重要GC，当然这个词用的不多，如果不知道的情况下默认为老年代GC即可。</p>
<p>​    <strong>Mixed gc</strong>： 混合GC，这个概念最开始应该是在G1才提到，值得是老年代和新生代以及大对象一起回收</p>
<h2 id="系统真正怕的是什么？"><a href="#系统真正怕的是什么？" class="headerlink" title="系统真正怕的是什么？"></a>系统真正怕的是什么？</h2><p>​    <strong>垃圾收集的stop world操作</strong>，但是可以明显的发现，新生代的回收几乎是没有影响了，有20ms没法操作系统，几乎没有几个人可以感知，就连我们连一个网页都不止几秒的时间，更不要说这微小的感知了。</p>
<p>​    但是老年代的回收就不一样了，我们假设老年代回收的时间需要新生代的10倍，那就是200ms，好像也是没啥感觉哈，但是如果是2000ms，那问题就很大了，CPU的处理速度如果需要停顿2S那基本会让人误以为是程序出了问题，所以老年代的停顿是不可容忍的。</p>
<h2 id="系统内存过大的问题："><a href="#系统内存过大的问题：" class="headerlink" title="系统内存过大的问题："></a>系统内存过大的问题：</h2><p>​    如果采用传统的分代模型作用于现在动辄上百G的服务，那么假设新老年代需要几十个G的内存，那么一次停顿的时间大概到了一分钟了，因为对象太多了，回收的效率直线下降。</p>
<p>​    因此超大内存的出现也是G1收集器出现的一个原因之一。</p>
<h2 id="如何解决大内存系统的垃圾回收问题？"><a href="#如何解决大内存系统的垃圾回收问题？" class="headerlink" title="如何解决大内存系统的垃圾回收问题？"></a>如何解决大内存系统的垃圾回收问题？</h2><p>​    使用G1收集器，该收集器首先会判断新生代是否占用的比率符合停顿模型的参数，此时需要根据参数判断是否需要进行处理，如果需要处理，则根据最大停顿时间进行垃圾回收、</p>
<p>​    其实本质上就是把本来触发条件回收变成了定时判断是否符合垃圾回收的条件，有一点垃圾就回收一点，这样系统可以正常运行，垃圾回收也可以尽可能的回收内存，并且只要垃圾回收的速度赶上分配速度，那么整个系统是基本上不会有任何JVM问题的！</p>
<h2 id="要命的老年代回收！"><a href="#要命的老年代回收！" class="headerlink" title="要命的老年代回收！"></a>要命的老年代回收！</h2><p>​    老年代回收肯定是因为新生代出了问题，因为对象没有地方放得时候老年代肯定就会执行了，老年代回收本来就比新生代慢十倍，加上频繁的老年代更加容易让系统卡顿，让用户体验变得非常差。</p>
<p>之前总结过老年代回收的一些条件：</p>
<ol>
<li>动态对象年龄判断：如果老年代的可用对象大于新生代，那么基本没有问题，但是一旦小于这个值，就需要校验一下老年代的最大连续空间是否大于历代晋升老年代的平均大小，如果是则执行mior gc，如果不是此时老年代肯定是放不下则需要进行Full Gc了，的。</li>
<li>对象年龄超过阈值：一般是1 -15 ，注意也只有1 -15，没有23，25，26，30这些参数，因为Marking word对象头只给了4位 1111表示对象的年龄！</li>
<li>对象回收之后，存活的对象在老年代放不下了。</li>
<li>CMS并发回收的过程中一旦剩余空间无法分配，会出现concurrent mode fail并且开启Serrial进行Full gc。</li>
</ol>
<h2 id="如何选择cms-Parnew还是g1？"><a href="#如何选择cms-Parnew还是g1？" class="headerlink" title="如何选择cms+Parnew还是g1？"></a>如何选择cms+Parnew还是g1？</h2><p>​    Parnew+cms：一般中小型的系统对于系统的性能要求不是很高，同时也不需要高同步和实时特征的时候使用</p>
<p>​    G1收集器：如果是超大内存的系统适合使用g1的收集器。</p>
<h2 id="什么时候触发永久代回收？"><a href="#什么时候触发永久代回收？" class="headerlink" title="什么时候触发永久代回收？"></a>什么时候触发永久代回收？</h2><p>​    永久代回收的空间有限，多数情况下存放了类变量和一些静态的常量或者.class对象的引用信息，需要注意的是反射和动态代理对象是最容易引发永久代溢出的，特别是现代框架多数使用反射加载对象，导致方法区不断出现对象占用。方法去一旦回收基本都是OOM.</p>
<p>​    不断创建动态代理对象也是测试方法区溢出效果的最好办法。</p>
<h2 id="几乎没有影响-young-gc"><a href="#几乎没有影响-young-gc" class="headerlink" title="几乎没有影响 young gc?"></a>几乎没有影响 young gc?</h2><p>​    假设一个业务系统是初期阶段，用户量不是很大，每秒大概也就500次请求，生产的对象大概也就是50M左右，假设大概3分钟就能把新生代填满，同时频繁的young gc，但是会发现这一次young gc也就花了20ms几乎是无法被用户感知的。</p>
<p>​    但是多数情况下业务初期根本不需要调优JVM。</p>
<p>​    另外，调优不要为了调优而调优，自己做的开源项目可以乱搞，但是公司拿来赚钱的项目是需要多方面考虑的，切记。</p>
<h2 id="系统升级后垃圾收集器的影响"><a href="#系统升级后垃圾收集器的影响" class="headerlink" title="系统升级后垃圾收集器的影响"></a>系统升级后垃圾收集器的影响</h2><p>​    假设一台小机器系统升级到32核16G,老年代和新生代占用6G左右，这时再使用分代回收的方式效率十分低了，所以我们使用G1收集器进行垃圾的回收的工作并且让回收操作提前完成也是保证后续的计算任务不会造成卡顿或者阻塞。</p>
<h1 id="写在最后"><a href="#写在最后" class="headerlink" title="写在最后"></a>写在最后</h1><p>​    不断复习和回顾总结，知识才能学得更加牢靠！</p>
<script type="text/javascript" src="https://cdn.jsdelivr.net/npm/kity@2.0.4/dist/kity.min.js"></script><script type="text/javascript" src="https://cdn.jsdelivr.net/npm/kityminder-core@1.4.50/dist/kityminder.core.min.js"></script><script defer="true" type="text/javascript" src="https://cdn.jsdelivr.net/npm/hexo-simple-mindmap@0.2.0/dist/mindmap.min.js"></script><link rel="stylesheet" type="text/css" href="https://cdn.jsdelivr.net/npm/hexo-simple-mindmap@0.2.0/dist/mindmap.min.css">
    </div>

    
    
    
        

<div>
<ul class="post-copyright">
  <li class="post-copyright-author">
    <strong>本文作者： </strong>lazytime
  </li>
  <li class="post-copyright-link">
    <strong>本文链接：</strong>
    <a href="https://whitestore.top/2022/01/28/huigu1/" title="深入理解JVM - 阶段总结与回顾（一）">https://whitestore.top/2022/01/28/huigu1/</a>
  </li>
  <li class="post-copyright-license">
    <strong>版权声明： </strong>本博客所有文章除特别声明外，均采用 <span class="exturl" data-url="aHR0cHM6Ly9jcmVhdGl2ZWNvbW1vbnMub3JnL2xpY2Vuc2VzL2J5LW5jLzQuMC96aC1DTg=="><i class="fa fa-fw fa-creative-commons"></i>BY-NC</span> 许可协议。转载请注明出处！
  </li>
</ul>
</div>


      <footer class="post-footer">
          <div class="post-tags">
              <a href="/tags/JVM/" rel="tag"># JVM</a>
          </div>

        


        
    <div class="post-nav">
      <div class="post-nav-item">
    <a href="/2022/01/28/yueliang/" rel="prev" title="《月亮与六便士》读书笔记">
      <i class="fa fa-chevron-left"></i> 《月亮与六便士》读书笔记
    </a></div>
      <div class="post-nav-item">
    <a href="/2022/01/28/bikanhaoshu/" rel="next" title="推荐6本年轻人必看的好书（豆瓣8.0以上）">
      推荐6本年轻人必看的好书（豆瓣8.0以上） <i class="fa fa-chevron-right"></i>
    </a></div>
    </div>
      </footer>
    
  </article>
  
  
  



          </div>
          
    <div class="comments" id="valine-comments"></div>

<script>
  window.addEventListener('tabs:register', () => {
    let { activeClass } = CONFIG.comments;
    if (CONFIG.comments.storage) {
      activeClass = localStorage.getItem('comments_active') || activeClass;
    }
    if (activeClass) {
      let activeTab = document.querySelector(`a[href="#comment-${activeClass}"]`);
      if (activeTab) {
        activeTab.click();
      }
    }
  });
  if (CONFIG.comments.storage) {
    window.addEventListener('tabs:click', event => {
      if (!event.target.matches('.tabs-comment .tab-content .tab-pane')) return;
      let commentClass = event.target.classList[1];
      localStorage.setItem('comments_active', commentClass);
    });
  }
</script>

        </div>
          
  
  <div class="toggle sidebar-toggle">
    <span class="toggle-line toggle-line-first"></span>
    <span class="toggle-line toggle-line-middle"></span>
    <span class="toggle-line toggle-line-last"></span>
  </div>

  <aside class="sidebar">
    <div class="sidebar-inner">

      <ul class="sidebar-nav motion-element">
        <li class="sidebar-nav-toc">
          文章目录
        </li>
        <li class="sidebar-nav-overview">
          站点概览
        </li>
      </ul>

      <!--noindex-->
      <div class="post-toc-wrap sidebar-panel">
          <div class="post-toc motion-element"><ol class="nav"><li class="nav-item nav-level-1"><a class="nav-link" href="#深入理解JVM-阶段总结与回顾（一）"><span class="nav-number">1.</span> <span class="nav-text">深入理解JVM - 阶段总结与回顾（一）</span></a></li><li class="nav-item nav-level-1"><a class="nav-link" href="#前言"><span class="nav-number">2.</span> <span class="nav-text">前言</span></a></li><li class="nav-item nav-level-1"><a class="nav-link" href="#为什么开设专栏"><span class="nav-number">3.</span> <span class="nav-text">为什么开设专栏</span></a></li><li class="nav-item nav-level-1"><a class="nav-link" href="#系列文章阶段总结："><span class="nav-number">4.</span> <span class="nav-text">系列文章阶段总结：</span></a></li><li class="nav-item nav-level-1"><a class="nav-link" href="#相关讨论"><span class="nav-number">5.</span> <span class="nav-text">相关讨论</span></a><ol class="nav-child"><li class="nav-item nav-level-2"><a class="nav-link" href="#回收的说法我混淆了？"><span class="nav-number">5.1.</span> <span class="nav-text">回收的说法我混淆了？</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#系统真正怕的是什么？"><span class="nav-number">5.2.</span> <span class="nav-text">系统真正怕的是什么？</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#系统内存过大的问题："><span class="nav-number">5.3.</span> <span class="nav-text">系统内存过大的问题：</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#如何解决大内存系统的垃圾回收问题？"><span class="nav-number">5.4.</span> <span class="nav-text">如何解决大内存系统的垃圾回收问题？</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#要命的老年代回收！"><span class="nav-number">5.5.</span> <span class="nav-text">要命的老年代回收！</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#如何选择cms-Parnew还是g1？"><span class="nav-number">5.6.</span> <span class="nav-text">如何选择cms+Parnew还是g1？</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#什么时候触发永久代回收？"><span class="nav-number">5.7.</span> <span class="nav-text">什么时候触发永久代回收？</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#几乎没有影响-young-gc"><span class="nav-number">5.8.</span> <span class="nav-text">几乎没有影响 young gc?</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#系统升级后垃圾收集器的影响"><span class="nav-number">5.9.</span> <span class="nav-text">系统升级后垃圾收集器的影响</span></a></li></ol></li><li class="nav-item nav-level-1"><a class="nav-link" href="#写在最后"><span class="nav-number">6.</span> <span class="nav-text">写在最后</span></a></li></ol></div>
      </div>
      <!--/noindex-->

      <div class="site-overview-wrap sidebar-panel">
        <div class="site-author motion-element" itemprop="author" itemscope itemtype="http://schema.org/Person">
  <p class="site-author-name" itemprop="name">阿东</p>
  <div class="site-description" itemprop="description">随遇而安</div>
</div>
<div class="site-state-wrap motion-element">
  <nav class="site-state">
      <div class="site-state-item site-state-posts">
          <a href="/archives/">
        
          <span class="site-state-item-count">239</span>
          <span class="site-state-item-name">日志</span>
        </a>
      </div>
      <div class="site-state-item site-state-categories">
            <a href="/categories/">
          
        <span class="site-state-item-count">36</span>
        <span class="site-state-item-name">分类</span></a>
      </div>
      <div class="site-state-item site-state-tags">
            <a href="/tags/">
          
        <span class="site-state-item-count">37</span>
        <span class="site-state-item-name">标签</span></a>
      </div>
  </nav>
</div>
  <div class="links-of-author motion-element">
      <span class="links-of-author-item">
        <span class="exturl" data-url="aHR0cHM6Ly9naXRodWIuY29tL2xhenlUaW1lcw==" title="GitHub → https:&#x2F;&#x2F;github.com&#x2F;lazyTimes"><i class="fa fa-fw fa-github"></i>GitHub</span>
      </span>
      <span class="links-of-author-item">
        <span class="exturl" data-url="bWFpbHRvOjEwOTc0ODM1MDhAcXEuY29t" title="E-Mail → mailto:1097483508@qq.com"><i class="fa fa-fw fa-envelope"></i>E-Mail</span>
      </span>
  </div>


  <div class="links-of-blogroll motion-element">
    <div class="links-of-blogroll-title">
      <i class="fa fa-fw fa-link"></i>
      友情链接
    </div>
    <ul class="links-of-blogroll-list">
        <li class="links-of-blogroll-item">
          <span class="exturl" data-url="aHR0cHM6Ly93d3cuNTJwb2ppZS5jbi9ob21lLnBocD9tb2Q9c3BhY2UmdWlkPTE0OTc3MTgmZG89dGhyZWFkJnZpZXc9bWUmZnJvbT1zcGFjZQ==" title="https:&#x2F;&#x2F;www.52pojie.cn&#x2F;home.php?mod&#x3D;space&amp;uid&#x3D;1497718&amp;do&#x3D;thread&amp;view&#x3D;me&amp;from&#x3D;space">吾爱破解</span>
        </li>
        <li class="links-of-blogroll-item">
          <span class="exturl" data-url="aHR0cHM6Ly9qdWVqaW4uaW0vdXNlci8yOTk5MTIzNDUyNjI2MzY2" title="https:&#x2F;&#x2F;juejin.im&#x2F;user&#x2F;2999123452626366">掘金</span>
        </li>
        <li class="links-of-blogroll-item">
          <span class="exturl" data-url="aHR0cHM6Ly9zZWdtZW50ZmF1bHQuY29tL3UvbGF6eXRpbWVz" title="https:&#x2F;&#x2F;segmentfault.com&#x2F;u&#x2F;lazytimes">思否</span>
        </li>
    </ul>
  </div>

      </div>

      <div class="wechat_OA">
        <span>欢迎关注我的公众号</span>
        <br>
          <!-- 这里添加你的二维码图片 -->
        <img src ="https://adong-picture.oss-cn-shenzhen.aliyuncs.com/adong/wechat_channel.jpg">
      </div>
        <div class="back-to-top motion-element">
          <i class="fa fa-arrow-up"></i>
          <span>0%</span>
        </div>

    </div>
  </aside>
  <div id="sidebar-dimmer"></div>


      </div>
    </main>

    <footer class="footer">
      <div class="footer-inner">
        

        

<div class="copyright">
  
  &copy; 
  <span itemprop="copyrightYear">2023</span>
  <span class="with-love">
    <i class="fa fa-user"></i>
  </span>
  <span class="author" itemprop="copyrightHolder">阿东</span>
    <span class="post-meta-divider">|</span>
    <span class="post-meta-item-icon">
      <i class="fa fa-area-chart"></i>
    </span>
      <span class="post-meta-item-text">站点总字数：</span>
    <span title="站点总字数">2m</span>
    <span class="post-meta-divider">|</span>
    <span class="post-meta-item-icon">
      <i class="fa fa-coffee"></i>
    </span>
      <span class="post-meta-item-text">站点阅读时长 &asymp;</span>
    <span title="站点阅读时长">29:50</span>
</div>
  <div class="powered-by">由 <span class="exturl theme-link" data-url="aHR0cHM6Ly9oZXhvLmlv">Hexo</span> & <span class="exturl theme-link" data-url="aHR0cHM6Ly90aGVtZS1uZXh0Lm9yZw==">NexT.Gemini</span> 强力驱动
  </div>

        
<div class="busuanzi-count">
  <script async src="https://busuanzi.ibruce.info/busuanzi/2.3/busuanzi.pure.mini.js"></script>
    <span class="post-meta-item" id="busuanzi_container_site_uv" style="display: none;">
      <span class="post-meta-item-icon">
        <i class="fa fa-user"></i>
      </span>
      <span class="site-uv" title="总访客量">
        <span id="busuanzi_value_site_uv"></span>
      </span>
    </span>
    <span class="post-meta-divider">|</span>
    <span class="post-meta-item" id="busuanzi_container_site_pv" style="display: none;">
      <span class="post-meta-item-icon">
        <i class="fa fa-eye"></i>
      </span>
      <span class="site-pv" title="总访问量">
        <span id="busuanzi_value_site_pv"></span>
      </span>
    </span>
</div>








      </div>
    </footer>
  </div>

  
  <script src="/lib/anime.min.js"></script>
  <script src="//cdn.jsdelivr.net/npm/jquery@3/dist/jquery.min.js"></script>
  <script src="//cdn.jsdelivr.net/gh/fancyapps/fancybox@3/dist/jquery.fancybox.min.js"></script>
  <script src="/lib/velocity/velocity.min.js"></script>
  <script src="/lib/velocity/velocity.ui.min.js"></script>

<script src="/js/utils.js"></script>

<script src="/js/motion.js"></script>


<script src="/js/schemes/pisces.js"></script>


<script src="/js/next-boot.js"></script>




  




  
<script src="/js/local-search.js"></script>













  

  


<script>
NexT.utils.loadComments(document.querySelector('#valine-comments'), () => {
  NexT.utils.getScript('//unpkg.com/valine/dist/Valine.min.js', () => {
    var GUEST = ['nick', 'mail', 'link'];
    var guest = 'nick,mail,link';
    guest = guest.split(',').filter(item => {
      return GUEST.includes(item);
    });
    new Valine({
      el         : '#valine-comments',
      verify     : false,
      notify     : true,
      appId      : 'qMUpEEvBgXaMDD1b0ftgi9xr-gzGzoHsz',
      appKey     : 'UCdfT4Rfih6MO6y8DI4fstf6',
      placeholder: "Just go go",
      avatar     : 'mm',
      meta       : guest,
      pageSize   : '10' || 10,
      visitor    : false,
      lang       : 'zh-CN' || 'zh-cn',
      path       : location.pathname,
      recordIP   : false,
      serverURLs : ''
    });
  }, window.Valine);
});
</script>

</body>
</html>
